const express = require('express');
const cors = require('cors')
const app = express();
const port = 8000;
const langjiRouter = require("./router/langji")
var bodyParser = require('body-parser')
app.use(bodyParser.urlencoded({ extended: false }))
app.use(cors())
app.use((req, res, next) => {
    console.log(`Received request for URL: ${req.originalUrl}`);
    // 将控制权传递给下一个中间件或路由处理程序
    next();
});
app.use('/langji', langjiRouter)

// 定义一个简单的路由
app.get('/', (req, res) => {
    res.send('Hello, Express!');
});

// 启动服务器
app.listen(port, () => {
    console.log(`Server is running on port ${port}`);
});